package com.kfzx.www.animationdemo;

import android.animation.ValueAnimator;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;

public class MoneyIncreationAcitvity extends AppCompatActivity {
    private TextView mTextView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_money_increation_acitvity);

        mTextView = (TextView) findViewById(R.id.text_view);
        ValueAnimator valueAnimator = ValueAnimator.ofFloat(0, 2000);
        valueAnimator.setDuration(2000);
        valueAnimator.start();
        valueAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator valueAnimator) {
                float money = (Float) valueAnimator.getAnimatedValue();
                mTextView.setText("" + money);
            }
        });
    }
}
